package com.example.discover

import com.example.discover.repository.BookRepository
import com.example.discover.repository.BookWebService
import com.example.featuresdk.dao.BookDao
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit

@Module
@InstallIn(SingletonComponent::class)
class BookModule {

    @Provides
    fun bookWebService(retrofit: Retrofit): BookWebService = retrofit.create(BookWebService::class.java)

    @Provides
    fun bookRepository(bookDao: BookDao, bookWebService: BookWebService): BookRepository {
         return BookRepository(bookDao,bookWebService)
    }
}